package com.ngmaster.socket.handler;



import com.ngmaster.socket.MessageHandler;
import com.ngmaster.socket.message.ReadOrModifyWashFixedTimeMessage;
import com.ngmaster.socket.message.ReadOrModifyWashTimeMessage;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * 定时冲洗时间读写 请求或应答消息
 * */
@Slf4j
@Component
public class ReceiveReadOrModifyWashFixedTimeHandler extends MessageHandler<ReadOrModifyWashFixedTimeMessage> {

    @Override
    public boolean handleMessage(ReadOrModifyWashFixedTimeMessage protocolMessage) {
        log.info("[ReceiveReadOrModifyWashFixedTimeHandler] [receive] [msg:{}]", protocolMessage);
        if (protocolMessage.getMinutes() > 0) { // 表示读取
            super.handleMessage(protocolMessage);
        }
        return true;
    }

    @Override
    public String getApiUrl() {
        return super.getApiUrl() + "rw_wash_fix_time";
    }
}
